"""
Constants for the cloud storage SDK.

This module contains global constants used throughout the SDK.
"""

# Provider names
PROVIDER_BAIDU = "baidu"
PROVIDER_ALIYUN = "aliyun"
PROVIDER_ONEDRIVE = "onedrive"
PROVIDER_GOOGLE_DRIVE = "google_drive"
PROVIDER_TIANYI = "tianyi"
PROVIDER_TIANYI_PC = "tianyi_pc"
PROVIDER_TIANYI_TV = "tianyi_tv"

# API endpoints (examples, actual endpoints would be different)
BAIDU_API_BASE_URL = "https://pan.baidu.com/rest/2.0/xpan"
ALIYUN_API_BASE_URL = "https://api.aliyundrive.com/v2"
ONEDRIVE_API_BASE_URL = "https://graph.microsoft.com/v1.0"
GOOGLE_DRIVE_API_BASE_URL = "https://www.googleapis.com/drive/v3"
TIANYI_API_BASE_URL = "https://api.cloud.189.cn"

# HTTP status codes
HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_FORBIDDEN = 403
HTTP_NOT_FOUND = 404
HTTP_CONFLICT = 409
HTTP_TOO_MANY_REQUESTS = 429
HTTP_INTERNAL_SERVER_ERROR = 500

# File size limits (in bytes)
MAX_FILE_SIZE_BAIDU = 5 * 1024 * 1024 * 1024  # 5GB
MAX_FILE_SIZE_ALIYUN = 10 * 1024 * 1024 * 1024  # 10GB
MAX_FILE_SIZE_ONEDRIVE = 250 * 1024 * 1024 * 1024  # 250GB
MAX_FILE_SIZE_GOOGLE_DRIVE = 100 * 1024 * 1024 * 1024  # 100GB
MAX_FILE_SIZE_TIANYI = 20 * 1024 * 1024 * 1024  # 20GB

# Chunk sizes for multipart uploads (in bytes)
CHUNK_SIZE_BAIDU = 4 * 1024 * 1024  # 4MB
CHUNK_SIZE_ALIYUN = 10 * 1024 * 1024  # 10MB
CHUNK_SIZE_ONEDRIVE = 320 * 1024 * 1024  # 320MB
CHUNK_SIZE_GOOGLE_DRIVE = 8 * 1024 * 1024  # 8MB
CHUNK_SIZE_TIANYI = 10 * 1024 * 1024  # 10MB

# Default values
DEFAULT_CHUNK_SIZE = 8 * 1024 * 1024  # 8MB
DEFAULT_TIMEOUT = 30  # seconds
DEFAULT_MAX_RETRIES = 3
DEFAULT_RETRY_DELAY = 1  # seconds

# OAuth scopes
BAIDU_OAUTH_SCOPES = ["basic", "netdisk"]
ALIYUN_OAUTH_SCOPES = ["user:base", "file:all:read", "file:all:write"]
ONEDRIVE_OAUTH_SCOPES = ["https://graph.microsoft.com/Files.ReadWrite"]
GOOGLE_DRIVE_OAUTH_SCOPES = ["https://www.googleapis.com/auth/drive"]
TIANYI_OAUTH_SCOPES = ["basic", "netdisk"]

# Error messages
ERROR_UNSUPPORTED_PROVIDER = "Unsupported provider: {provider}"
ERROR_INVALID_CREDENTIALS = "Invalid credentials"
ERROR_FILE_NOT_FOUND = "File not found: {file_path}"
ERROR_INSUFFICIENT_STORAGE = "Insufficient storage space"
ERROR_QUOTA_EXCEEDED = "Quota exceeded"
ERROR_NETWORK_ERROR = "Network error: {message}"
ERROR_AUTH_FAILED = "Authentication failed: {message}"
ERROR_UPLOAD_FAILED = "File upload failed: {message}"
ERROR_DOWNLOAD_FAILED = "File download failed: {message}"
ERROR_DELETE_FAILED = "File deletion failed: {message}"
ERROR_CREATE_FOLDER_FAILED = "Folder creation failed: {message}"
ERROR_LIST_FILES_FAILED = "File listing failed: {message}"
ERROR_GET_ACCOUNT_INFO_FAILED = "Failed to get account info: {message}"
ERROR_GET_FILE_INFO_FAILED = "Failed to get file info: {message}"
ERROR_LIST_TRASH_FAILED = "Failed to list trash: {message}"
ERROR_RESTORE_FROM_TRASH_FAILED = "Failed to restore from trash: {message}"
ERROR_EMPTY_TRASH_FAILED = "Failed to empty trash: {message}"
ERROR_SEARCH_FILES_FAILED = "Failed to search files: {message}"

# File types
FILE_TYPE_DOCUMENT = "document"
FILE_TYPE_IMAGE = "image"
FILE_TYPE_VIDEO = "video"
FILE_TYPE_AUDIO = "audio"
FILE_TYPE_ARCHIVE = "archive"
FILE_TYPE_OTHER = "other"

# MIME types
MIME_TYPE_TEXT_PLAIN = "text/plain"
MIME_TYPE_JSON = "application/json"
MIME_TYPE_OCTET_STREAM = "application/octet-stream"
MIME_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded"
MIME_TYPE_MULTIPART_FORM_DATA = "multipart/form-data"

# Hash algorithms
HASH_ALGORITHM_MD5 = "md5"
HASH_ALGORITHM_SHA1 = "sha1"
HASH_ALGORITHM_SHA256 = "sha256"

# Date formats
DATE_FORMAT_ISO = "%Y-%m-%dT%H:%M:%S.%fZ"
DATE_FORMAT_SIMPLE = "%Y-%m-%d %H:%M:%S"

# Configuration keys
CONFIG_ACCESS_TOKEN = "access_token"
CONFIG_REFRESH_TOKEN = "refresh_token"
CONFIG_CLIENT_ID = "client_id"
CONFIG_CLIENT_SECRET = "client_secret"
CONFIG_REDIRECT_URI = "redirect_uri"
CONFIG_APP_ID = "app_id"
CONFIG_APP_KEY = "app_key"
CONFIG_SECRET_KEY = "secret_key"
CONFIG_EXPIRES_AT = "expires_at"
CONFIG_USER_ID = "user_id"
CONFIG_USERNAME = "username"
CONFIG_EMAIL = "email"
CONFIG_TOTAL_STORAGE = "total_storage"
CONFIG_USED_STORAGE = "used_storage"

# Log levels
LOG_LEVEL_DEBUG = "DEBUG"
LOG_LEVEL_INFO = "INFO"
LOG_LEVEL_WARNING = "WARNING"
LOG_LEVEL_ERROR = "ERROR"
LOG_LEVEL_CRITICAL = "CRITICAL"